Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(app): disallow non .py or .json protocol upload #16076

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

ncdiehl11
Copy link
Collaborator

@ncdiehl11 ncdiehl11 commented Aug 20, 2024

Overview

Analagous to our handling of non-.json custom labware upload, we want to disallow upload of .py or .json files on Desktop. Expected behavior is to check the filename extension of the prospective uploaded file (erring on the side of lenient acceptance), and close the slideout and make error toast if the extension is not .py or .json.

Closes RQA-2959

Test Plan and Hands on Testing

  • On Desktop, navigate to Protocols landing and select 'Import'
  • On slideout, import a non-.json or .py file through file explorer or drag-and-drop
  • Verify that slideout closes and "Incompatible file type" error toast renders
  • Repeat with a .json or .py file and verify that slideout closes and protocol is added and analysis begins

With other protocols:

Screen.Recording.2024-08-20.at.4.03.34.PM.mov

With no other protocols:

Screen.Recording.2024-08-20.at.4.02.48.PM.mov

Changelog

  • Check attempted uploaded protocol file extension before adding protocol
  • Make toast and close slideout if invalid file

Review requests

  • See code and test plan. If there is a different pattern for file type checking as specified in isValidProtocolFileName, I can update.

Risk assessment

Low-medium. We want to allow any attempted upload within reasonable file type matching

Analagous to our handling of non-.json custom labware upload, we want to disallow upload of .py or
.json files on Desktop. Expected behavior is to check the filename extension of the prospective
uploaded file (erring on the side of lenient acceptance), and close the slideout and make error
toast if the extension is not .py or .json.

Closes RQA-2959
@ncdiehl11 ncdiehl11 self-assigned this Aug 20, 2024
@ncdiehl11 ncdiehl11 marked this pull request as ready for review August 20, 2024 20:22
@ncdiehl11 ncdiehl11 requested a review from a team as a code owner August 20, 2024 20:22
@ncdiehl11 ncdiehl11 requested review from TamarZanzouri, a team, shlokamin, mjhuff and jerader and removed request for a team August 20, 2024 20:22
Copy link
Contributor

@koji koji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ncdiehl11 ncdiehl11 merged commit 8b081d7 into chore_release-8.0.0 Aug 21, 2024
26 checks passed
@ncdiehl11 ncdiehl11 deleted the fix_app-upload-protocol-filetype branch August 21, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants